/**
 * 打印出实心 10*10 正方形、空心 10*10 正方形
 * 封装成方法
 */
public class Square02 {
    //打印实心正方形
    public static void  solidSquare(int n){
        for (int a=1;a<=n;a++){
            for (int b=1;b<=n;b++){
                System.out.print("* ");
            }
            System.out.println();
        }
    }
    //打印空心正方形
    public static void hollowSquare(int n){
        for (int a=1;a<=n;a++){
            for (int b=1;b<=n;b++){
                if(a==1||a==n||b==1||b==n){
                    System.out.print("* ");
                }else {
                    System.out.print("  ");
                }
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        solidSquare(10);
        System.out.println("-----分割线-----");
        hollowSquare(10);
    }
}
